﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace RedBit.ExtensionMethods
{
    public static class BCLExtension
    {
        /// <summary>
        /// Gets the key at the specified index of the System.Collections.Specialized.NameValueCollection.
        /// </summary>
        /// <param name="items"></param>
        /// <param name="keyName"></param>
        /// <returns></returns>
        public static string GetKey(this Dictionary<string, string> items, string keyName)
        {
            foreach (var item in items)
            {
                if (item.Key.Equals(keyName))
                    return item.Key;
            }

            return string.Empty;
        }
    }
}
